import {
	getActivityInfoByPid,
	shareActivity,
	createPoster,
	getActivityList,
	getActivityInfoBySid,
	getActivityInfoByAid
} from '../../api/activity.js'

export default {
	state: {},
	mutations: {

	},
	getters: {

	},
	actions: {
		getActivityInfoByPid( {}, payload ) {
			return new Promise( ( resolve, reject ) => {
				getActivityInfoByPid( payload ).then( res => {
					resolve( res )
				} ).catch( err => {
					reject( err )
				} )
			} )
		},
		getActivityInfoBySid( {}, payload ) {
			return new Promise( ( resolve, reject ) => {
				getActivityInfoBySid( payload ).then( res => {
					resolve( res )
				} ).catch( err => {
					reject( err )
				} )
			} )
		},
		getActivityInfoByAid( {}, payload ) {
			return new Promise( ( resolve, reject ) => {
				getActivityInfoByAid( payload ).then( res => {
					resolve( res )
				} ).catch( err => {
					reject( err )
				} )
			} )
		},
		shareActivity( {}, payload ) {
			return new Promise( ( resolve, reject ) => {
				shareActivity( payload ).then( res => {
					resolve( res )
				} ).catch( err => {
					reject( err )
				} )
			} )
		},
		createPoster( {}, payload ) {
			return new Promise( ( resolve, reject ) => {
				createPoster( payload ).then( res => {
					resolve( res )
				} ).catch( err => {
					reject( err )
				} )
			} )
		},
		getActivityList( {}, payload ) {
			return new Promise( ( resolve, reject ) => {
				getActivityList( payload ).then( res => {
					resolve( res )
				} ).catch( err => {
					reject( err )
				} )
			} )
		},
	},
	namespaced: true
}
